/*
 * header.js
 */
/*var jq=jquery.noConflict();*/

var nav_p_his;
$(document).ready(function(){
	
	$("#nav li").each(function() {
		var urlstr  = location.href;
		if ((urlstr + '/').indexOf($(this).attr('name')) > -1 && $(this).attr('name')!='') {
			$(this).addClass('active'); 
		} else {
			$(this).removeClass('active');
		}
	});
	
 });
  


function getBasePath(){
	return $("#basePath").attr("value");
}

function userLoginCheck(){
	var username = $("input[name=username]").val();
	var password = $("input[name=password]").val();
	if(username.length > 0 && password.length > 0){
		return true;
	}else{
		location.href= getBasePath()+ "/pageLogin" + "?accountError=true";
	}
		
//	}else if(username.length == 0){
//		alert("Please input the user name!");
//	}else if(password.length == 0){
//		alert("Please input the password!")
//	}
	
	$("#username").attr("value","");
	$("#password").attr("value","");
}


